﻿@{
    ViewBag.Title = "Scheduler";
}

<h2>Scheduler</h2>
After you chose your courses, it is the time to set the constraints and invoke the automatic scheduler. <br />

<ol class="round">
    <li class="one">
        <h5>Group Constraints</h5>
        You can specify which groups you want and which you don't.
    </li>
    <li class="two">
        <h5>No running</h5>
        Make sure you don't have to run between buildings during a 10-minute break.
    </li>
    <li class="three">
        <h5>Free days</h5>
        Make sure your schedule has at least as many free days as you request.
    </li>
    <li class="four">
        <h5>Extra sleep</h5>
        Set number of sleep hours.       
    </li>
    <li class="five">
    <h5>Schedules:</h5>
    <table class="schedule">
        <tr>
            <th class="schedule">Sunday</th>
            <th class="schedule">Monday</th>
            <th class="schedule">Tuesday</th>
            <th class="schedule">Wednesday</th>
            <th class="schedule">Thursday</th>
            <th class="schedule">Friday</th>
            <th class="schedule">Saturday</th>
        </tr>
        @if(ViewBag.Table != null)
        {
            for(int i=0; i < 14; i++) 
            {
                <tr class="schedule">
                    <td>
                        @((i+7).ToString()):00
                    </td>
                    <td>
                    @if(ViewBag.Table[i,0] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,0][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 1] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,1][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 2] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,2][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 3] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,3][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 4] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,4][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 5] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,5][0].Role
                    }
                    </td>
                    <td>
                    @if (ViewBag.Table[i, 6] != null)
                    {
                        //Currently just show the first one in the list:
                        @ViewBag.Table[i,6][0].Role
                    }
                    </td>
                </tr>
            }
        }
    </table>

    <br /><br />

    </li>

    <li class="six">
        <h5>Exams Table</h5>
        Show exams table of your selected courses
        <a href="javascript:void(0)" id="examslink" onclick="loadExamsTable();">>></a>       
        <table id="examsTable">
        </table>
    </li>
</ol>